import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';

import 'models/ad_list_result_model.dart';
import 'models/pickerItem_model.dart';
import 'more_picker/ad_picker.dart';
import 'single_picker/single_picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///选择器集合
class Pickers {
  ///行政区划弹窗选择器
  ///
  ///[data]数据集，只匹配行政区划模型,非通用
  ///
  ///[selectData],绑定的值
  ///
  ///[onConfirm]确定回调
  ///
  ///[onAll]全部回调
  static void showAdPicker(
      {required List<AdItemModel> data,
      dynamic selectData,
      required AdCallback onConfirm,
      AllCallback? onAll,
      String? title}) {
    Get.bottomSheet(
        AdPickerContentView(
          selectData: selectData,
          onConfirm: onConfirm,
          onAll: onAll,
          data: data,
          title: title,
        ),
        isScrollControlled: true,
        enableDrag: false,
        backgroundColor: Colors.transparent);
  }

  static void showSinglePicker({
    required List<PickerItemModel> data,
    dynamic selectData,
    required SingleCallback onConfirm,
    String? title,
  }) {
    Get.bottomSheet(
        SinglePickerContentView(
            data: data,
            selectData: selectData,
            onConfirm: onConfirm,
            title: title),
        isScrollControlled: true,
        enableDrag: false,
        backgroundColor: Colors.transparent);
  }
}
